<template>
  <a-card :bordered="false">
      <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="单据编号">
              <j-input placeholder="请输入单据编号" v-model="queryParam.fbillno"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="申请人">
              <select-user-by-dep :multi="false" v-model="queryParam.employeeId" ></select-user-by-dep>
            </a-form-item>
          </a-col>
          <a-col :xl="10" :lg="11" :md="12" :sm="24">
            <a-form-item label="业务日期">
              <j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.fdate_begin"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.fdate_end"></j-date>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="11" :md="12" :sm="24">
            <a-form-item label="实付金额">
              <a-input-number placeholder="请输入最小值" class="query-group-cust" :precision="2" v-model="queryParam.fpaytotalamountforH_begin" style="width:calc(50% - 15px);"></a-input-number>
              <span class="query-group-split-cust"></span>
              <a-input-number placeholder="请输入最大值" class="query-group-cust" :precision="2" :min="queryParam.fpaytotalamountforH_begin" v-model="queryParam.fpaytotalamountforH_end" style="width:calc(50% - 15px);"></a-input-number>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="11" :md="12" :sm="24">
            <a-form-item label="收款单位类型">
              <j-dict-select-tag type="list" v-model="queryParam.frectunittype" dictCode="f_contact_unit_type" placeholder="请选择收款单位类型"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="11" :md="12" :sm="24">
            <a-form-item label="付款类型">
              <j-dict-select-tag type="list" v-model="queryParam.fqaspassistant2" dictCode="reimbursement_type" placeholder="请选择付款类型"/>
            </a-form-item>
          </a-col>
          <!-- <a-col :xl="6" :lg="11" :md="12" :sm="24" v-if="queryParam.frectunittype">
            <a-form-item label="收款单位">
              <j-search-select type="list" v-if="queryParam.frectunittype=='BD_Supplier'" v-model="queryParam.frectunitdata" dict="erp_finance_kingdee_base_supplier_info,fname,fnumber" placeholder="请选择收款单位" />
              <j-search-select type="list" v-else-if="queryParam.frectunittype=='BD_Customer'" v-model="queryParam.frectunitdata" dict="erp_finance_kingdee_base_custom_info,fname,fnumber" placeholder="请选择收款单位" />
              <j-search-select type="list" v-else-if="queryParam.frectunittype=='BD_Empinfo'" v-model="queryParam.frectunitdata" dict="erp_employee_file,name,employee_no" placeholder="请选择收款单位" />
            </a-form-item>
          </a-col> -->
          <a-col :xl="6" :lg="11" :md="12" :sm="24">
            <a-form-item label="是否同步">
              <j-dict-select-tag type="list" v-model="queryParam.isSync" dictCode="yes_or_no" placeholder="请选择是否同步"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="11" :md="12" :sm="24">
            <a-form-item label="是否通知">
              <j-dict-select-tag type="list" v-model="queryParam.isNotice" dictCode="yes_or_no" placeholder="请选择是否通知"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="createTimeRange=[],searchReset()" icon="reload" style="margin-left: 8px">重置</a-button>
              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a> -->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <!-- <a-button @click="handleAdd" type="primary" icon="plus" :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:add')">新增</a-button> -->
      <!--<a-button type="primary" icon="download" @click="handleExportXls('ERP-金蝶付款单')" :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:export')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import" :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:import')">导入</a-button>
      </a-upload>
      -->
      <!-- 高级查询区域 -->
      <!--<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <!-- <a-menu-item key="1" @click="batchDel" :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:delete')"><a-icon type="delete"/>删除</a-menu-item> -->
          <a-menu-item key="1" @click="handleAsync()" :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:delete')">同步单据</a-menu-item>
          <a-menu-item key="2" @click="handleAsyncData()" :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:delete')">更新单据</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
      <a-popover title="自定义列" trigger="click" placement="leftBottom">
        <template slot="content">
          <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
            <a-row>
              <template v-for="(item,index) in defColumns">
                <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
                  <a-col :span="12"><a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox></a-col>
                </template>
              </template>
            </a-row>
          </a-checkbox-group>
        </template>
        <a style="float: right;"><a-icon type="setting" :style='iconStyle'/></a>
      </a-popover>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:'110%'}"
        :components="draggableComponent"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @change="handleTableChange">
        <template slot="status" slot-scope="status">
           <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
        </template>
        <span slot="fbillno" slot-scope="text, record">
          <a @click="goDetail(record)">{{ text }}</a>
        </span>
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>


        <span slot="action" slot-scope="text, record">

        <template v-if="record.isSync=='0'">
          <a-popconfirm title="确定同步吗?" @confirm="() => handleAsync(record)" v-has="'erpFinanceKingdeePaymentBill:async'" >
            <a href="javascript:;"  :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:async')" >同步单据</a>
          </a-popconfirm>
        </template>
        <template v-else-if="record.isSync=='1'">
          <a-popconfirm title="确定更新吗?" @confirm="() => handleAsyncData(record)" v-has="'erpFinanceKingdeePaymentBill:update'" >
            <a href="javascript:;" :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:update')">更新单据</a>
          </a-popconfirm>
        </template>
          <a-divider type="vertical"/>

          <a-dropdown>
            <a class="ant-dropdown-link">
              更多 <a-icon type="down"/>
            </a>
            <a-menu slot="overlay">
              <template v-if="!record.fbillno.includes('_') && record.erpBillType=='3' && record.applyPaymentAmount!=record.realPaymentAmount">
                <a-menu-item >
                  <a href="javascript:;" @click="handleRepush(record)"  :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:repush')">再次下推</a>
                </a-menu-item>
              </template>
              <a-menu-item v-if="!record.fbillno.includes('_') && record.erpBillType=='3'">
                <a href="javascript:;" @click="getPaymentList(record)"  :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:getPaymentList')">关联付款单</a>
              </a-menu-item>
              <a-menu-item>
                <a href="javascript:;" @click="getRecordList(record)" v-has="'erpFinanceKingdeePaymentBill:getRecord'"  :disabled="isDisabledAuth('erpFinanceKingdeePaymentBill:getRecord')">交单记录</a>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
    <ErpFinanceKingdeePaymentRecordListPenetrate ref="paymentList"></ErpFinanceKingdeePaymentRecordListPenetrate>
    <ErpFinanceRecordListPenetrate  ref="recordList"></ErpFinanceRecordListPenetrate>
    <erp-finance-kingdee-payment-bill-modal ref="modalForm" @ok="modalFormOk"></erp-finance-kingdee-payment-bill-modal>
    <ErpFinanceReimbursementPenetrate  ref="reimbursementPenetrate"></ErpFinanceReimbursementPenetrate>
    <ErpFinanceLoanBillPenetrate ref="loanBillPenetrate" ></ErpFinanceLoanBillPenetrate>
    <ErpFinancePaymentBillPenetrate ref="paymentBillPenetrate" ></ErpFinancePaymentBillPenetrate>
    <ErpFinanceDepositBillPenetrate ref="projectDepositBillPenetrate" ></ErpFinanceDepositBillPenetrate>
    <ErpFinanceTraveBillPenetrate ref="traveBillPenetrate" ></ErpFinanceTraveBillPenetrate>

    <a-modal :width="560" :visible="flag" title="再次下推" @cancel="handleCancel" >
      <a-row :gutter="24">
    <!-- 单据编号 -->
    <a-col :span="24">
      <a-form-item label="单据编号">
        <span class="bill-no">{{ model.fbillno }}</span>
      </a-form-item>
    </a-col>
    <!-- 金额信息（申请支付金额、已付金额、剩余未付金额） -->
    <a-col :span="24">
      <a-row :gutter="16">
        <!-- 申请支付金额 -->
        <a-col :span="8">
          <a-form-item label="申请支付金额">
            <span class="amount">{{ model.applyPaymentAmount }} 元</span>
          </a-form-item>
        </a-col>

        <!-- 已付金额 -->
        <a-col :span="8">
          <a-form-item label="已付金额">
            <span class="amount">{{ model.realPaymentAmount }} 元</span>
          </a-form-item>
        </a-col>

        <!-- 剩余未付金额 -->
        <a-col :span="8">
          <a-form-item label="剩余未付金额">
            <span class="amount">{{ (model.applyPaymentAmount-model.realPaymentAmount).toFixed(2) }} 元</span>
          </a-form-item>
        </a-col>
      </a-row>
    </a-col>
    <!-- 本次付款金额 -->
    <a-col :span="24">
      <a-form-item label="本次付款金额">
        <a-input v-show="false" v-model="model.id" />
        <a-input-number
          :max="999999999"
          :min="0"
          :precision="2"
          v-model="model.amount"
          placeholder="请输入本次付款金额"
          class="full-width"
        />
      </a-form-item>
    </a-col>
  </a-row>
      <template #footer>
        <a-button @click="handleCancel">关闭</a-button>
        <a-button  type="primary" @click="handleOK" :loading="modalLoading" :disabled="modalDisabled">确定</a-button>
      </template>
      </a-modal>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ErpFinanceKingdeePaymentBillModal from './modules/ErpFinanceKingdeePaymentBillModal'
  import { getAction,postAction } from '@/api/manage'
  import {DisabledAuthFilterMixin} from '@/mixins/DisabledAuthFilterMixin'
  import SelectUserByDep from '@/views/scy/components/SelectUserByDep'
  import JSearchSelect from '@/views/erp/finance/kingdee/payment/JSearchSelect.vue'
  import ErpFinanceRecordListPenetrate from '@/views/scy/penetrate/ErpFinanceRecordListPenetrate'
  import ErpFinanceKingdeePaymentRecordListPenetrate from '@/views/scy/penetrate/ErpFinanceKingdeePaymentRecordListPenetrate'

  export default {
    name: 'ErpFinanceKingdeePaymentBillList',
    mixins:[JeecgListMixin, mixinDevice, DisabledAuthFilterMixin],
    components: {
      JSearchSelect,
      SelectUserByDep,
      ErpFinanceKingdeePaymentBillModal,
      ErpFinanceRecordListPenetrate,
      ErpFinanceKingdeePaymentRecordListPenetrate,
      ErpFinanceReimbursementPenetrate: () => import('@/views/scy/penetrate/ErpFinanceReimbursementPenetrate'),
      ErpFinanceLoanBillPenetrate: () => import('@/views/scy/penetrate/ErpFinanceLoanBillPenetrate'),
      ErpFinancePaymentBillPenetrate: () => import('@/views/scy/penetrate/ErpFinancePaymentBillPenetrate'),
      ErpFinanceDepositBillPenetrate: () => import('@/views/scy/penetrate/ErpFinanceDepositBillPenetrate'),
      ErpFinanceTraveBillPenetrate: () => import('@/views/scy/penetrate/ErpFinanceTraveBillPenetrate')
    },
    data () {
      return {
        modalDisabled:false,
        modalLoading:false,
        flag:false,
        model:{},
        description: 'ERP-金蝶付款单管理页面',
        //表头
        columns:[],
        //列设置
        settingColumns:[],
        // 列定义
        defColumns: [
          {
            title: '序号',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'单据类型',
            align:"center",
            dataIndex: 'fbilltypeiddata_dictText',
            width:150,
            ellipsis: true
          },
          {
            title:'单据编号',
            align:"center",
            dataIndex: 'fbillno',
            scopedSlots: { customRender: 'fbillno' },
            width:160,
            ellipsis: true
          },
          {
            title:'付款申请人',
            align:"center",
            width:100,
            dataIndex: 'fxyhgbase_dictText',
          },
          {
            title:'业务日期',
            align:"center",
            dataIndex: 'fdate',
            width:150,
            ellipsis: true
          },
          // {
          //   title:'审核人',
          //   align:"center",
          //   dataIndex: 'fapproveriddata_dictText',
          // },
          // {
          //   title:'创建日期',
          //   align:"center",
          //   dataIndex: 'fcreatedate',
          //   ellipsis: true
          // },
          {
            title:'结算组织',
            align:"center",
            dataIndex: 'fsettleorgiddata_dictText',
            width:200,
            ellipsis: true
          },
          // {
          //   title:'付款组织',
          //   align:"center",
          //   dataIndex: 'fpayorgiddata_dictText',
          //   ellipsis: true
          // },
          // {
          //   title:'审核日期',
          //   align:"center",
          //   dataIndex: 'fapprovedate',
          // },
          // {
          //   title:'采购组织',
          //   align:"center",
          //   dataIndex: 'fpurchaseorgiddata_dictText',
          // },
          {
            title:'应付金额',
            align:"center",
            width:150,
            dataIndex: 'fpaytotalamountforH',
          },
          {
            title:'实付金额',
            align:"center",
            width:150,
            dataIndex: 'frealpayamountforH',
          },
          // {
          //   title:'币别',
          //   align:"center",
          //   dataIndex: 'fcurrencyid',
          // },
          {
            title:'往来单位类型',
            align:"center",
            width:100,
            dataIndex: 'fcontactunittype_dictText',
          },
          {
            title:'往来单位',
            align:"center",
            width:250,
            dataIndex: 'fcontactunitdata_dictText',
            ellipsis: true
          },
          {
            title:'收款单位类型',
            align:"center",
            width:100,
            dataIndex: 'frectunittype_dictText',
          },
          {
            title:'收款单位',
            align:"center",
            width:250,
            dataIndex: 'frectunitdata_dictText',
            ellipsis: true
          },
          {
            title:'报销类型',
            align:"center",
            dataIndex: 'fqaspassistant2_dictText',
            width:150,
          },
          // {
          //   title:'是否期初单据',
          //   align:"center",
          //   dataIndex: 'fisinit',
          // },

          // {
          //   title:'本位币',
          //   align:"center",
          //   dataIndex: 'fmainbookid',
          // },
          // {
          //   title:'结算币别',
          //   align:"center",
          //   dataIndex: 'fsettlecur',
          // },
          // {
          //   title:'应付金额本位币',
          //   align:"center",
          //   dataIndex: 'fpaytotalamountH',
          // },
          // {
          //   title:'付款金额本位币',
          //   align:"center",
          //   dataIndex: 'fpayamount',
          // },
          // {
          //   title:'实付金额本位币',
          //   align:"center",
          //   dataIndex: 'frealpayamountH',
          // },
          // {
          //   title:'是否其他预付',
          //   align:"center",
          //   dataIndex: 'fisborrow',
          // },
          // {
          //   title:'erp单据id',
          //   align:"center",
          //   dataIndex: 'erpBillId',
          // },
          // {
          //   title:'erp单据类型',
          //   align:"center",
          //   dataIndex: 'erpBillType',
          // },
          // {
          //   title:'项目',
          //   align:"center",
          //   dataIndex: 'fqaspassistant1_dictText',
          // },
          {
            title:'备注',
            align:"center",
            width:250,
            dataIndex: 'fremark',
            ellipsis: true
          },
          // {
          //   title:'核算业务类型',
          //   align:"center",
          //   dataIndex: 'fqaspAssistant',
          // },
          // {
          //   title:'单据状态',
          //   align:"center",
          //   dataIndex: 'fdocumentstatus',
          // },
          {
            title:'是否同步',
            align:"center",
            dataIndex: 'isSync_dictText',
            width:80,
          },
          {
            title:'支付状态',
            align:"center",
            width:100,
            dataIndex: 'payStatus_dictText',
          },
          {
            title:'通知状态',
            align:"center",
            width:100,
            dataIndex: 'isNotice',
            customRender: (text) => {
              if (text=='0') {
                return '未通知'
              } else if (text=='1') {
                return '已通知'
              }
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:180,
            scopedSlots: {
            filterDropdown: 'filterDropdown',
            filterIcon: 'filterIcon',
            customRender: 'action' }
          }
        ],
        url: {
          list: "/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/list",
          delete: "/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/delete",
          deleteBatch: "/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/deleteBatch",
          exportXlsUrl: "/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/exportXls",
          importExcelUrl: "/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/importExcel",
          asyncKingdee: "/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/asyncKingdee",
          asyncKingdeeData: "/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/asyncKingdeeData",
          repushData:"/api/erp/finance/kingdee/erpFinanceKingdeePaymentBill/rePushPaymentBill"
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      getPaymentList(record){
        //先清空数据
        this.$refs.paymentList.dataSource = []
        this.$refs.paymentList.ipagination.total = 0
        //查询数据
        this.$refs.paymentList.loading = true
        this.$refs.paymentList.erpBillId = record.erpBillId
        this.$refs.paymentList.searchReset()
        //打开弹窗
        this.$refs.paymentList.visible = true
      },
      getRecordList(record){
        //先清空数据
        this.$refs.recordList.dataSource = []
        this.$refs.recordList.ipagination.total = 0
        //查询数据
        this.$refs.recordList.loading = true
        this.$refs.recordList.billNo = record.fbillno
        this.$refs.recordList.searchReset()
        //打开弹窗
        this.$refs.recordList.visible = true
      },
      // 加载穿透表单
      goDetail(record) {
        if (record.erpBillType == '1') {
          this.$refs.reimbursementPenetrate.initData(record.erpBillId);
          this.$refs.reimbursementPenetrate.visible = true;
        } else if (record.erpBillType == '2') {
          this.$refs.traveBillPenetrate.initData(record.erpBillId);
          this.$refs.traveBillPenetrate.visible = true;
        } else if (record.erpBillType == '3') {
          this.$refs.paymentBillPenetrate.initData(record.erpBillId);
          this.$refs.paymentBillPenetrate.visible = true;
        } else if(record.erpBillType == '4'){
          this.$refs.projectDepositBillPenetrate.initData(record.erpBillId);
          this.$refs.projectDepositBillPenetrate.visible = true;
        }else if(record.erpBillType == '5'){
          this.$refs.loanBillPenetrate.initData(record.erpBillId);
          this.$refs.loanBillPenetrate.visible = true;
        }
      },
      handleAsyncData(record){
        let params=null;
        if(record){
          params={ids:record.id}
        }else{
          var ids = ''
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ','
          }
          params={ids:ids}
        }
        getAction(this.url.asyncKingdeeData,params).then((res) => {
          if (res.success) {
            this.$message.success(res.message)
            this.loadData();
            this.onClearSelected()
          }else{
            this.$message.error(res.message)
          }
        })
      },
      handleRepush(record){
        this.flag=true;
        this.model=record;
      },
      handleCancel(){
        this.flag=false;
        this.$set(this.model,"amount",null);
      },
      handleOK(){
        let params=null;
        this.modalLoading=true;
        this.modalDisabled=true;
        if(this.model){
          params={id:this.model.id,amount:this.model.amount}
        }
        getAction(this.url.repushData, params).then((res) => {
          if (res.success) {
            this.$message.success(res.message)
            this.flag=false;
            this.model={amount:0}
            this.loadData();
            this.onClearSelected()
            this.modalLoading=false;
            this.modalDisabled=false;
          }else{
            this.$message.error(res.message)
            this.modalLoading=false;
            this.modalDisabled=false;
          }
        })
      },
      handleAsync(record){
        let params=null;
        if(record){
          params={ids:record.id}
        }else{
          var ids = ''
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ','
          }
          params={ids:ids}
        }
        getAction(this.url.asyncKingdee, params).then((res) => {
          if (res.success) {
            this.$message.success(res.message)
            this.loadData();
            this.onClearSelected()
          }else{
            this.$message.error(res.message)
          }
        })
      },
      handleDetail: function (record) {
        this.$refs.modalForm.edit(record);
        this.$refs.modalForm.title = '详情';
        this.$refs.modalForm.disableSubmit = true;
    },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'fbillno',text:'单据编号',dictCode:''})
        fieldList.push({type:'string',value:'fcreatorid',text:'创建人',dictCode:''})
        fieldList.push({type:'string',value:'fapproverid',text:'审核人',dictCode:''})
        fieldList.push({type:'date',value:'fcreatedate',text:'创建日期'})
        fieldList.push({type:'string',value:'fsettleorgid',text:'结算组织',dictCode:''})
        fieldList.push({type:'date',value:'fapprovedate',text:'审核日期'})
        fieldList.push({type:'string',value:'fpurchaseorgid',text:'采购组织',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'fpaytotalamountforH',text:'表头-应付金额',dictCode:''})
        fieldList.push({type:'string',value:'fcurrencyid',text:'币别',dictCode:''})
        fieldList.push({type:'date',value:'fdate',text:'业务日期'})
        fieldList.push({type:'string',value:'fbilltypeid',text:'单据类型',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'frealpayamountforH',text:'表头-实付金额',dictCode:''})
        fieldList.push({type:'string',value:'faccountsystem',text:'会计核算体系',dictCode:''})
        fieldList.push({type:'string',value:'fcontactunittype',text:'往来单位类型',dictCode:''})
        fieldList.push({type:'string',value:'fcontactunit',text:'往来单位',dictCode:''})
        fieldList.push({type:'string',value:'frectunittype',text:'收款单位类型',dictCode:''})
        fieldList.push({type:'string',value:'frectunit',text:'收款单位',dictCode:''})
        fieldList.push({type:'string',value:'fsourcesystem',text:'来源系统',dictCode:''})
        fieldList.push({type:'string',value:'fbusinesstype',text:'业务类型',dictCode:''})
        fieldList.push({type:'string',value:'fisinit',text:'是否期初单据',dictCode:''})
        fieldList.push({type:'string',value:'fpayorgid',text:'付款组织',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'fpayamountfor',text:'付款金额',dictCode:''})
        fieldList.push({type:'string',value:'fmainbookid',text:'本位币',dictCode:''})
        fieldList.push({type:'string',value:'fsettlecur',text:'结算币别',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'fpaytotalamountH',text:'表头-应付金额本位币',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'fpayamount',text:'表头-付款金额本位币',dictCode:''})
        fieldList.push({type:'BigDecimal',value:'frealpayamountH',text:'表头-实付金额本位币',dictCode:''})
        fieldList.push({type:'string',value:'fremark',text:'备注',dictCode:''})
        fieldList.push({type:'string',value:'fisborrow',text:'是否其他预付',dictCode:''})
        fieldList.push({type:'string',value:'isSync',text:'是否同步',dictCode:''})
        fieldList.push({type:'string',value:'erpBillId',text:'erp单据id',dictCode:''})
        fieldList.push({type:'string',value:'erpBillType',text:'erp单据类型',dictCode:''})
        fieldList.push({type:'string',value:'fqaspAssistant1',text:'项目',dictCode:''})
        fieldList.push({type:'string',value:'fqaspAssistant',text:'核算业务类型',dictCode:''})
        fieldList.push({type:'string',value:'fdocumentstatus',text:'单据状态',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
  .bill-no {
  color: #1890ff;
  cursor: pointer;
  font-size: 14px;
}

/* 金额样式 */
.amount {
  color: #333;
  font-size: 16px;
  font-weight: bold;
}

/* 分割线样式 */
.divider {
  border: 0;
  border-top: 1px solid #e8e8e8;
  margin: 16px 0;
}

/* 输入框宽度 */
.full-width {
  width: 100%;
}

/* 表单项标签样式 */
.ant-form-item-label label {
  font-weight: bold;
  color: #333;
}
</style>
